package algorithms;

/**
 * A class that stores Two integers - used as a Key for the CPA's and SP's
 *
 */
public class TwoIntegers implements Comparable<TwoIntegers>{
	public int int1;
	public int int2;

	/**
	 * Creates an instance of TwoIntegers
	 * @param int1 first integer
	 * @param int2 seconds integer
	 */
	public TwoIntegers(int int1, int int2){
		this.int1 = int1;
		this.int2 = int2;
	}

	@Override
	public int compareTo(TwoIntegers o) {
		if (this.int1 < o.int1){
			return -1; 
		} else if (this.int1 > o.int1){
			return 1;
		} else {
			if (this.int2 < o.int2){
				return -1; 
			} else if (this.int2 > o.int2){
				return 1;
			} else {
				return 0;
			}
		}
	}
	
	@Override
	public String toString() {
		return "<" + int1 + ", " + int2+">";
	}
}